package com.house.house3.controller;

import com.house.house3.pojo.User;
import com.house.house3.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
//@Scope("prototype")
public class UserController {

//    @Resource
    @Autowired
    private UserService userService;

    @RequestMapping("user")
    public List<User> getUsers(){
        List<User> list = userService.getUsers();
        return list;
//        return userService.getUsers();
    }
}
